xlv.obj.scrollPane={
	extend:function(){
	},
	implement:function(){
	},
	create:function(tag){
		var div=document.createElement((tag||'div'));
		div.setAttribute('xlvobject','xlv.obj.scrollPane');
		Element.addClassName(div,'class_scrollPane');
		return div;
	},
	properties:{
		contentWidth:null,
		contentHeight:null,
		options:{
			desktopCompatibility:true
		}			
	},
	method:{
		construct:function(){
			var content=document.createElement('div');
			content.setAttribute('id','xlvid_iscroll_content');
			while(this.firstChild)content.appendChild(this.firstChild);
			this.appendChild(content);
			this.$V.content=content;
		},
		initial:function(){
			if(this.effectable() && !this.$P.options.onScrollEnd)this.$P.options.onScrollEnd = (function(){this.scrollEnd();}).bind(this);
			Element.addClassName(this,'class_scrollPane');
			Element.setStyle(this,{position:'relative'});
			if(this.$P.contentWidth) this.$V.content.style.width=this.$P.contentWidth+'px';
			if(this.$P.contentHeight) this.$V.content.style.height=this.$P.contentHeight+'px';
			this.styleFor(this);
			this.styleForId(this.$V.content, this.$V.content.id);
			if(this.effectable())this.$V.iscroll = new iScroll(this.$V.content,this.$P.options);
		},
		effectable:function(){
			return (Prototype.Browser.WebKit);//MobileSafari
		},
		styleFor:function(pane){
		},
		styleForId:function(facilities,id){
		},
		dispose:function(){
			if(this.$V.iscroll) this.$V.iscroll.destroy();
		},
		getiScroll:function(){
			return this.$V.iscroll;
		},
		scrollEnd:function(){
		},
		getScrollX:function(){
			return (this.$V.iscroll)?this.$V.iscroll.x:this.scrollLeft;
		},
		getScrollY:function(){
			return (this.$V.iscroll)?this.$V.iscroll.y:this.scrollTop;
		},
		scrollTo:function(x,y){
			var v=this.$V;
			if(v.iscroll) {
				x = (x!=null)?x:v.iscroll.x;
				y = (y!=null)?y:v.iscroll.y;
				v.iscroll.scrollTo(x,y);
			}else {
				var cont=v.content;
				if(x!=null) cont.style.left='0px';
				if(y!=null) cont.style.top='0px';
				var option={element:this,properties:{}};
				if(x!=null)option.properties.scrollLeft=-x;
				if(y!=null)option.properties.scrollTop=-y;	
				option.duration=350;
				option.finished=(function(){this.scrollEnd();}).bind(this);
				xlv.util.styleEffect(option);
			}
		}
		
	}
};
